********************************************************************************
********************************************************************************
* This do file replicates all main figures and table of the field 
* experiment: Figure 4, Table 2, 3, and 4.
********************************************************************************
*******************************************************************************

*******************************************************************************
*** Figure 4. Callback rate by the level of language skills.                
*******************************************************************************

use Data/data_field_experiment_JHR, clear

global resume_X ccity1 ccity2 ccountry1 ccountry2 ccountry3 occ_mekaniker-occ_kundtjänstpersonal occ_personligassistent-occ_supporttekniker aappl_type2 aappl_type3 aappl_order2 aappl_order3

preserve
 collapse (mean)callback_mean = callback (semean) se_callback = callback, by(language_level)
 gen callbacku = callback_mean + 1.96*se_callback
 gen callbackl = callback_mean - 1.96*se_callback
 save tmp_figure4, replace
restore

append using tmp_figure4
erase tmp_figure4.dta

label define language_label 0 "Level 1" 1 "Level 2" 2 "Level 3" 3 "Level 4"
label values language_level language_label 
tab language_level

twoway (lfit callback language_level, lcolor(black) acolor(gs12) range(-0.2 3.2)) ///
(lfitci callback language_level, lcolor(black) acolor(gs12) range(-0.2 3.2)) ///
(scatter callback_mean language_level, mcolor(black) msize(small)), ///
xlabel(0 "Level 1" 1 "Level 2" 2 "Level 3" 3 "Level 4") ///
ytitle("Fraction") xtitle("Language") ylabel(0.0(0.05)0.20) yscale(range(0.0(0.05)0.20)) ///
xscale(range(-0.2(0.5)3.5)) ///
graphregion(color(gs16))   plotregion(style(none)) ///
legend(off) 
 
*******************************************************************************
*** Table 2. Descriptive results of the field experiment.
*******************************************************************************

use Data/data_field_experiment_JHR, clear

tab callback
tab low_skill
tab occ if low_skill == 1
tab callback if low_skill == 1
tab medium_skill
tab callback if medium_skill == 1
tab occ if medium_skill == 1
tab high_skill
tab callback if high_skill == 1
tab occ if high_skill == 1
bys occ: tab callback
tab occ

*******************************************************************************
*** Table 3. The effect of language proficiency on the callback rate.
*******************************************************************************

use Data/data_field_experiment_JHR, clear

global resume_X ccity1 ccity2 ccountry1 ccountry2 ccountry3 occ_mekaniker-occ_kundtjänstpersonal occ_personligassistent-occ_supporttekniker aappl_type2 aappl_type3 aappl_order2 aappl_order3

* Column 1 
reg callback language_level , robust
reg callback L2 L3 L4 , robust
* Column 2
reg callback language_level $resume_X, robust
reg callback L2 L3 L4 $resume_X, robust
* Column 3
reg callback language_level $resume_X, cluster(occ_city)
reg callback L2 L3 L4 $resume_X, cluster(occ_city)

*******************************************************************************
*** Table 4. The effect of language proficiency on the callback rate,
*** by occupational groupings 
*******************************************************************************

use Data/data_field_experiment_JHR, clear

global resume_X ccity1 ccity2 ccountry1 ccountry2 ccountry3 occ_mekaniker-occ_kundtjänstpersonal occ_personligassistent-occ_supporttekniker aappl_type2 aappl_type3 aappl_order2 aappl_order3

* Panel A: Occupational skill level
reg callback  lang_low_skill lang_medium_skill lang_high_skill $resume_X, robust
test lang_low_skill = lang_medium_skill = lang_high_skill

* Panel B: Occupations historically requiring less Swedish
reg callback llevel_Lang_not_freq_used llevel_Lang_freq_used  $resume_X , robust 
test llevel_Lang_not_freq_used = llevel_Lang_freq_used

* Panel C: : Share of immigrants in occupation
reg callback llevel_immig_gr_p50 llevel_immig_less_p50 $resume_X, robust 
test llevel_immig_gr_p50 = llevel_immig_less_p50 

* Panel D: Female vs. male dominated job
reg callback llevel_Female llevel_Male $resume_X, robust 
test llevel_Female = llevel_Male 






